<template>
  <div>
    <el-form
      :inline="true"
      :model="fromdata"
      label-width="120px"
    >
      <el-row>
        <el-col :span="12">客户信息</el-col>
      </el-row>
      <el-divider content-position="center"></el-divider>
      <el-row>
        <el-col :span="8">
          <el-form-item label="客户类型:" >
            <div>{{fromdata.clientType}}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="客户名称:" >
            <div>{{fromdata.clientName}}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="手机号:" label-width="80px">
            <div>{{fromdata.phone}}</div>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="驾驶证号:" >
            <div>{{value.drivingLicenceNumber}}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="驾驶证到期日期:" >
            <div>{{fromdata.drivingLicenceExpireDate}}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="生日:" label-width="80px">
            <div>{{fromdata.birthday}}</div>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="会员等级:" >
            <div>{{fromdata.memberGrade}}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="客户来源:" >
            <div>{{fromdata.clientSource}}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="地址:" label-width="80px">
            <div style="width: 200px">{{fromdata.address}}</div>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form> 

    <el-form
      :inline="true"
      :model="fromdata"
      label-width="110px"
    >
      <el-row>
        <el-col :span="12">商机信息</el-col>
      </el-row>
      <el-divider content-position="center"></el-divider>
      <el-row>
        <el-col :span="8">
          <el-form-item label="商机编号:" >
            <div>{{fromdata.code}}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="商机类型:" >
            <div>{{fromdata.type}}</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="发现商机时间:">
            <div>{{fromdata.createTime}}</div>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="处理状态:" >
            <div>{{fromdata.status}}</div>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="处理备注:" >
            <div>{{fromdata.remark}}</div>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form> 
  </div>
</template>

<script>
  import { getChanceById } from '@/api/after-sale/client/business'
  import baseMixin from '@/mixins/base'
  import { parseTimeToYMDHMS } from '@/utils'

  export default {
    name: 'editClientManage',
    components: { },
    props: {
      value: {
        type: Object,
        default: () => ({})
      }
    },
    mixins: [
      baseMixin({
        format(res) {
          return res.map(data => {
            return data
          })
        }
      })
    ],
    data() {
      return {
        fromdata: {}
      }
    },
    async created() {
      const { data } = await getChanceById(this.value.id)
      this.fromdata = data
    },
    methods: {
      changeType(item){
        this.selectedTypeText = item.label;
      },
      // canle(){
      //   this.$store.dispatch('delVisitedViews', this.$route)
      //   this.$router.push({ path: '/customer/customer' })
      // }
    },
    mounted() {
    }
  }
</script>

<style lang="scss" scoped>
  .el-table .delete-row {
    background: #f5f7fa;
    color: #ccc!important;
  }
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 80px;
    height: 80px;
    display: block;
  }
</style>
